﻿// Copyright 2007-2008 Rory Plaire (codekaizen@gmail.com)

namespace NPack.Interfaces
{
    /// <summary>
    /// Every class that defines a - operation 
    /// like <c>T operator - (T a, T b)</c> should consider
    /// implementing this interface.
    /// </summary>
    /// <typeparam name="T">Type which is subtractable.</typeparam>
    /// <remarks>
    /// Adapted from an article on lambda-computing.com: 
    /// http://www.lambda-computing.com/publications/articles/generics/IArithmetic.cs.
    /// </remarks>
    public interface ISubtractable<T>
    {
        /// <summary>
        /// Returns the difference of the Object and <paramref name="b"/>.
        /// It must not modify the value of the Object.
        /// </summary>
        /// <param name="b">The second operand.</param>
        /// <returns>The difference.</returns>
        T Subtract(T b);
    }
}
